home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / addlibrary.c < prev    next >
C/C++ Source or Header  |  1996-09-12  |  2KB  |  78 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: addlibrary.c,v 1.4 1996/08/13 13:55:55 digulla Exp $
  4.     $Log: addlibrary.c,v $
  5.     Revision 1.4  1996/08/13 13:55:55  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.3  1996/08/01 17:41:02  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include <exec/execbase.h>
  17. #include <aros/libcall.h>
  18.  
  19. /*****************************************************************************
  20.  
  21.     NAME */
  22.     #include <clib/exec_protos.h>
  23.  
  24.     __AROS_LH1(void, AddLibrary,
  25.  
  26. /*  SYNOPSIS */
  27.     __AROS_LHA(struct Library *, library,A1),
  28.  
  29. /*  LOCATION */
  30.     struct ExecBase *, SysBase, 66, Exec)
  31.  
  32. /*  FUNCTION
  33.     Adds a given library to the system's library list after checksumming
  34.     the library vectors. This function is not for general use but
  35.     (of course) for building shared librarys that don't use exec's
  36.     MakeLibrary() mechanism.
  37.  
  38.     INPUTS
  39.     library - Pointer to a ready for use library structure.
  40.  
  41.     RESULT
  42.  
  43.     NOTES
  44.  
  45.     EXAMPLE
  46.  
  47.     BUGS
  48.  
  49.     SEE ALSO
  50.     RemLibrary(), MakeLibrary(), MakeFunctions(), InitStruct(), SumLibrary().
  51.  
  52.     INTERNALS
  53.  
  54.     HISTORY
  55.  
  56. ******************************************************************************/
  57. {
  58.     __AROS_FUNC_INIT
  59.  
  60.     /* Just in case the user forgot them */
  61.     library->lib_Node.ln_Type=NT_LIBRARY;
  62.     library->lib_Flags|=LIBF_CHANGED;
  63.  
  64.     /* Build checksum for library vectors */
  65.     SumLibrary(library);
  66.  
  67.     /* Arbitrate for the library list */
  68.     Forbid();
  69.  
  70.     /* And add the library */
  71.     Enqueue(&SysBase->LibList,&library->lib_Node);
  72.  
  73.     /* All done. */
  74.     Permit();
  75.     __AROS_FUNC_EXIT
  76. } /* AddLibrary */
  77.  
  78.